package com.youxue.service;

import com.youxue.dao.ShoppingCollectionMapper;
import com.youxue.entity.ShoppingCollection;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by 15c on 2018/1/20.
 */
@Service("shoppingCollection")
public class ShoppingCollectionServiceImpl implements ShoppingCollectionSeivice {
    @Autowired
    ShoppingCollectionMapper shoppingCollectionMapper;

    @Override
    public int addShoppingOrCollection(ShoppingCollection shoppingCollection) {
        return shoppingCollectionMapper.insertSelective(shoppingCollection);
    }

    @Override
    public List<ShoppingCollection> showAllSC(Integer userId,Integer scType) {
        return shoppingCollectionMapper.selectAUserAllSc(userId,scType);
    }



    @Override
    public int deleteShoppingOrCollection(Integer scId,Integer scType,Integer userId) {
        return shoppingCollectionMapper.deleteByPrimaryKey(scId,scType,userId);
    }

    @Override
    public ShoppingCollection showAcladdBooleanAdd(Integer userId, Integer scType, Integer classId) {
        return shoppingCollectionMapper.selectBooleanAdd(userId,scType,classId);
    }

    @Override
    public int showAuserAllCountAboutShoppingOrCollection( Integer userId,Integer scType) {
        return shoppingCollectionMapper.selectAUserCountSc(userId,scType);
    }
}
